from core.rest_client import RestClient


class Api(RestClient):
    def __init__(self):
        super().__init__()

    def get_mobile_belong(self, **kwargs):
        return self.get("/shouji/query", **kwargs)

    def search_douban(self, **kwargs):
        return self.get("/movie/subject_search?", **kwargs)

    # 获取短信验证码
    def send_code(self, **kwargs):
        return self.post("/code/", **kwargs)

    # 注册登录
    def register_mobile(self, **kwargs):
        return self.post("/users/", **kwargs)

    def user_login(self, **kwargs):
        return self.post("/login/", **kwargs)

    def get_banner(self, **kwargs):
        return self.get("/banners/", **kwargs)

    def add_shop_car(self, **kwargs):
        return self.post("/shopcarts/", **kwargs)

    def add_message(self, **kwargs):
        return self.post("/messages/", **kwargs)


api_util = Api()
